#include <bits/stdc++.h>
// 2025/02/06
// tag: 
// Author: Zhang Muen
using namespace std;

using int64 = int64_t;

int n, m, w[2001], dp[2001], g[2001];

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);
    cin >> n >> m;
    for (int i = 1; i <= n; i++)
        cin >> w[i];
    dp[0] = 1;
    for (int i = 1; i <= n; i++)
        for (int j = m; j >= w[i]; j--)
            dp[j] += dp[j - w[i]], dp[j] %= 10;
    for (int i = 1; i <= n; i++){
        memcpy(g, dp, sizeof(dp));
        for (int j = w[i]; j <= m; j++)
            g[j] -= g[j - w[i]], g[j] = (g[j] + 10) % 10;
        for (int j = 1; j <= m; j++)
            cout << g[j];
        cout << endl;
    }
    return 0;
}